package com.ws.democxf.biz.impl;

import com.ws.democxf.biz.SysUserService;
import com.ws.democxf.entity.SysUser;
import org.springframework.stereotype.Component;

import javax.jws.WebService;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @author lzh
 * @date 2020/5/6 - 18:15
 */
@WebService(serviceName="SysUserService",//对外发布的服务名
        targetNamespace="http://democxf.ws.com",//指定你想要的名称空间，通常使用使用包名反转
        endpointInterface="com.ws.democxf.biz.SysUserService")//服务接口全路径, 指定做SEI（Service EndPoint Interface）服务端点接口
@Component
public class UserServiceImpl  implements SysUserService {

    private  Map<String, SysUser> userMap = new HashMap<String, SysUser>();
    public UserServiceImpl() {
        System.out.println("向实体类插入数据");
        SysUser user = new SysUser();
        user.setUserId(UUID.randomUUID().toString().replace("-", ""));
        user.setUserName("mracale01");
        user.setEmail("mracale01@163.xom");
        userMap.put(user.getUserId(), user);

        user = new SysUser();
        user.setUserId(UUID.randomUUID().toString().replace("-", ""));
        user.setUserName("mracale02");
        user.setEmail("mracale02@163.xom");
        userMap.put(user.getUserId(), user);

        user = new SysUser();
        user.setUserId(UUID.randomUUID().toString().replace("-", ""));
        user.setUserName("mracale03");
        user.setEmail("mracale03@163.xom");
        userMap.put(user.getUserId(), user);
    }

    @Override
    public SysUser getSysUser(String SysUserId) {
        System.out.println("userMap是:"+userMap);
        return userMap.get(SysUserId);
    }

    @Override
    public String getSysUserName(String SysUserId) {
        return "userId为：" + SysUserId;

    }

    @Override
    public Map<String, SysUser> getAllSysUserData() {
        return userMap;
    }
}
